package com.tangsm.spring.boot.aliyun.bailian.controller;

import com.tangsm.spring.boot.aliyun.bailian.dto.CreatVoiceDto;
import com.tangsm.spring.boot.aliyun.bailian.model.Result;
import com.tangsm.spring.boot.aliyun.bailian.service.VoiceService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/voice")
public class VoiceController {

    @Resource
    private VoiceService voiceService;

    /**
     * 创建音色（语音注册）
     *
     * @param creatVoiceDto 创建音色参数
     * @return 音色ID
     */
    @PostMapping("/createVoice")
    public Result<String> createTimbre(@RequestBody CreatVoiceDto creatVoiceDto) {
        // 调用服务层方法创建音色
        String voiceId = voiceService.createVoice(creatVoiceDto);
        return Result.success(voiceId);
    }
}